package com.jason.sms.agent.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.jason.sms.agent.util.PhoneNumberType;

public class SmsRequest implements Cloneable {

	private Long msgId;

	private String sender;

	private Map<PhoneNumberType, List<String>> desNumber;

	private String title;

	private PhoneNumberType numberType;

	private List<String> desAddress;

	private String content;

	private Date sendDate;

	public SmsRequest() {
		desNumber = new HashMap<PhoneNumberType, List<String>>();
	}

	public Long getMsgId() {
		return msgId;
	}

	public void setMsgId(Long msgId) {
		this.msgId = msgId;
	}

	public String getSender() {
		return sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}

	public Map<PhoneNumberType, List<String>> getDesNumber() {
		return desNumber;
	}

	public void setDesNumber(Map<PhoneNumberType, List<String>> desNumber) {
		this.desNumber = desNumber;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getSendDate() {
		return sendDate;
	}

	public void setSendDate(Date sendDate) {
		this.sendDate = sendDate;
	}

	public void addDestNumber(PhoneNumberType numberType, String destNumber) {
		List<String> destNumbers = desNumber.get(numberType);
		if (destNumbers == null) {
			destNumbers = new ArrayList<String>();
			desNumber.put(numberType, destNumbers);
		}
		destNumbers.add(destNumber);
	}

	public PhoneNumberType getNumberType() {
		return numberType;
	}

	public void setNumberType(PhoneNumberType numberType) {
		this.numberType = numberType;
	}

	public List<String> getDesAddress() {
		return desAddress;
	}

	public void setDesAddress(List<String> desAddress) {
		this.desAddress = desAddress;
	}

	public SmsRequest clone() {
		SmsRequest o = null;
		try {
			o = (SmsRequest) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return o;
	}

}
